<?
if ($_SESSION['member_id']) {
    echo"{$_SESSION['member_name']} 님의 {$_SESSION['member_log']} 번째 방문을 환영합니다. <br>
        id : {$_SESSION['member_id']} <br>
        이름 : {$_SESSION['member_name']} <br>
        level : {$_SESSION['member_level']} <br>
       <a onClick=\"logout();\">로그아웃</a>
    ";
} else {
    ?>
    <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center" class="padding_left7">
        <tr>
            <td id="login" width="600" class="right">
                <table >
                    <tr>
                        <td>
                            <input type="text" name="id" id="id" class="w_150">
                        </td>

                        <td rowspan="2" class="top">
                            <input type="button" class="w_100" style="height:100%" value="로그인" onClick="login();">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="password" id ="passwd" name="passwd" class="w_150">
                        </td>
                    </tr>
                </table>    
            </td>
        </tr>
    </table>
<?php } ?>
<script  language='JavaScript' charset='utf-8'>
    function login() {
        var id = $("#id").val();
        var passwd = $("#passwd").val();
        bbs.swapPage("<?= SCRIPT_ROOT; ?>/bbs/login/login_ok.php?id=" + id + "&passwd=" + passwd, "<?= $layer_id; ?>");
    }
    function logout() {
        alert('logout');
        bbs.swapPage("<?= SCRIPT_ROOT; ?>/bbs/login/logout_ok.php", "<?= $layer_id; ?>");
    }
</script>